﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Data.OleDb;
using DashBoardNegocios;

namespace DashBoardInterfaz
{
    public partial class frm_Default : System.Web.UI.Page
    {
        c_ControladorNegocios _Controlador;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
                lblSeguridad.Text = "...";
            }

        }

        /// <summary>
        /// MetodoLogin del sitio
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnLogin_Click(object sender, ImageClickEventArgs e)
        {
            Page.Validate();
            _Controlador = c_ControladorNegocios.getInstance();
           int _control = _Controlador._LogIn(txtUsuario.Text, txtPass.Text);
           if (_control == 1)
           {
               Session.Add("NombreUSUARIO", txtUsuario.Text);
               Response.Redirect("frmRangoFechas.aspx");
           }
           else
           {
               lblSeguridad.Visible = true;
               lblSeguridad.Text = "The information is incorrect";
           }
        }
    }
}